package Lab1;

import java.util.Collections;
import java.util.List;
import java.util.ArrayList;

public class PersonDriver2 {
	
	public static void main(String[] args) {
		List<Person> allPeoples = new ArrayList<Person>();
		int i=0;
		
		for(i=0;i<20;i++) {
			allPeoples.add(new Person("Guy#" + i, "Dude#" + i, 10 + i, "DERP#" + i));
		}
		
		Collections.shuffle(allPeoples);
		
		Person newguy = new Person("Guy#" + (i - 5), "Dude#" + (i - 1), 10 + i, "DERP#" + i);
		int foundpos = 0;
		int counter = 0;
		
		for(Person guy : allPeoples) {
			if (newguy.equals(guy)) {
				foundpos = counter;
			}
			counter += 1;
		}
		
		System.out.println("indexOf() return: \t\t" + foundpos);
		System.out.println("getEqualsCounter() return: \t" + newguy.getEqualsCounter());
	}
}
